Repository navigation
tss: Copy Ap,OSEnvironment from the build identity into AP requests - #14
Merged
Merged
Conversation
cloudOS build identities carry Ap,OSEnvironment (0x06, trusted darwinOS). Apple's restore host sends it in the AP TSS request; iBoot reads the value back from the ticket and applies the matching /osenvironments overlay of the device tree. Without it the restored device boots in the default environment, where cryptexes and Restricted Execution Mode are unavailable. Identities without the tag (every iOS one) are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cloudOS build identities (Private Cloud Compute, e.g. cloudOS 26.5 23F75, every
vresearch101apidentity) carryAp,OSEnvironment = "0x06". Apple's restore hostsends this tag in the AP TSS request. iBoot reads it back from the ticket and applies
the matching
/osenvironmentsoverlay of the device tree; for 6 that istrusted-darwinos, which sets/chosen/darwinos-security-environment = 6.libtatsu builds the AP parameters and request from a fixed list of
Ap,*tags thatdoes not include this one. A device restored through idevicerestore therefore gets a
ticket without an OS environment and boots in the default one. On cloudOS that leaves
Restricted Execution Mode off and research cryptexes unmountable (
hdi_mountEPERM).This copies the tag in
tss_parameters_add_from_manifest()andtss_request_add_ap_img4_tags(), next to the otherAp,*tags.plist_dict_copy_uint()takes the manifest's string ("0x06") throughplist_dict_get_uint()and sends an integer, like the other numeric tags. It changesnothing for an identity without the tag, which includes every iOS one.
Tested with the same change applied to idevicerestore's AP request (vphone-cli's vendored
copy), restoring a
vresearch101apidentity carrying the tag. TSS signed the ticket, andthe restored system booted in trusted darwinOS: AMFI logged its environment-6 path, and a
research cryptex was personalized and mounted. Without the tag the same restore boots in
the default environment. This patch itself has been compiled (
clang -fsyntax-only) butnot run.